<template>
  <div class="good-list-item" @click="itemClick"  >
    <img :src="showImg" alt="">
    <div class="good-list-text">
      <div class="good-list-title">{{goodsItem.title}}</div>
      <span class="price">{{goodsItem.price}}</span>
      <span class="collect">{{goodsItem.cfav}}</span>
    </div>
  </div>
</template>

<script>
  export default {
    name: "GoodListItem",
    props:{
      goodsItem:{
        type:Object,
        default(){
          return {}
        }
      }
    },
    computed:{
      showImg(){
        return this.goodsItem.show.img;
      }
    },
    methods:{
      itemClick(){
        this.$router.push('/detail/'+this.goodsItem.iid)
      }
    }

  }
</script>

<style scoped>
  .good-list-item{
    padding-bottom: 5px;
    width: 45%;


  }
  .good-list-item img{
    width: 100%;
    border-radius: 5px;

  }
  .good-list-text {

    font-size: 12px;
    bottom:10px;
    left: 0;
    right: 0;
    overflow: hidden;
    text-align: center;
  }
  .good-list-title{
    width: 100%;
    height: 14px;
    flex-wrap: wrap;
    display: inline-block;

    overflow: hidden;
  }
  .good-list-text .price{
    color: #E91E62;
    margin-right: 20px;
    position: relative;
  }
  .good-list-text .collect{
    position: relative;
  }

</style>